package com.gopay.checkorder.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.checkorder.dao.BcdlSendBankLogDAO;
import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.bank.BcdlSendBankLog;

/**
 * 
 * @author lizheng
 *
 */
@Repository(value = "bcdlSendBankLogDAO")
public class BcdlSendBankLogDAOImpl extends BaseDAOImpl<BcdlSendBankLog, String>implements BcdlSendBankLogDAO {
	
	   @Override
	    public BcdlSendBankLog getLogByGopayOrderId(String gopayOrderId) {
	        String hql = "from BcdlSendBankLog where gopayOrderId = :orderId";

	        Map<String, Object> params = new HashMap<String, Object>();
	        params.put("orderId", gopayOrderId);

	        List<BcdlSendBankLog> list = this.findByHql(hql, params);
	        if (list != null && list.size() > 0) {
	            return list.get(0);
	        }

	        return null;
	    }
	   
	   @Override
	   public void delLogByGopayOrderId(BcdlSendBankLog sendBankLog){
		   this.delete(sendBankLog);
	   }
}
